<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Key Types</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Icl">
<link rel="up" href="../function_reference.html" title="Function Reference">
<link rel="prev" href="segmentational_fineness.html" title="Segmentational Fineness">
<link rel="next" href="construct__copy__destruct.html" title="Construct, copy, destruct">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="segmentational_fineness.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="construct__copy__destruct.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section boost_icl_function_reference_key_types" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_icl.function_reference.key_types"></a><a class="link" href="key_types.html" title="Key Types">Key Types</a>
</h3></div></div></div>
<p>
        In an <span class="bold"><strong>stl</strong></span> map <code class="computeroutput"><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">K</span><span class="special">,</span><span class="identifier">D</span><span class="special">&gt;</span></code> the
        first parameter type of the map template <code class="computeroutput"><span class="identifier">K</span></code>
        is called <code class="computeroutput"><span class="identifier">key_type</span></code>. It allows
        to select key-value pairs pairs via <code class="computeroutput"><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">K</span><span class="special">&amp;)</span></code> and to remove key-value pairs using
        <code class="computeroutput"><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">K</span><span class="special">&amp;)</span></code>. For icl Maps we have generalized key
        types to a larger set of types. Not only the <code class="computeroutput"><span class="identifier">key_type</span></code>
        (<code class="computeroutput"><span class="identifier">domain_type</span></code>) but also an
        interval type and a set type can be <span class="emphasis"><em><span class="bold"><strong>key types</strong></span></em></span>,
        that allow for <span class="emphasis"><em><span class="bold"><strong>selection</strong></span></em></span>
        and <span class="emphasis"><em><span class="bold"><strong>removal</strong></span></em></span> of map
        elements segments and submaps.
      </p>
<div class="table">
<a name="id1135608"></a><p class="title"><b>Table&#160;1.16.&#160;Selection of elements, segments and sub maps using
      key types</b></p>
<div class="table-contents"><table class="table" summary="Selection of elements, segments and sub maps using
      key types">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
            <p>
            </p>
            </th>
<th>
            <p>
              <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a>:
              <code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_maps</a></code>
            </p>
            </th>
<th>
            <p>
              <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a>:
              icl_map
            </p>
            </th>
</tr></thead>
<tbody>
<tr>
<td>
            <p>
              <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>:
              <code class="computeroutput"><span class="identifier">domain_type</span></code>
            </p>
            </td>
<td>
            <p>
              key value pair
            </p>
            </td>
<td>
            <p>
              key value pair
            </p>
            </td>
</tr>
<tr>
<td>
            <p>
              <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a>:
              <code class="computeroutput"><span class="identifier">interval_type</span></code>
            </p>
            </td>
<td>
            <p>
              interval value pair
            </p>
            </td>
<td>
            <p>
            </p>
            </td>
</tr>
<tr>
<td>
            <p>
              <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a>:
              <code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_sets</a></code>
            </p>
            </td>
<td>
            <p>
              interval map
            </p>
            </td>
<td>
            <p>
            </p>
            </td>
</tr>
<tr>
<td>
            <p>
              <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a>:
              <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span></code> </a>
            </p>
            </td>
<td>
            <p>
            </p>
            </td>
<td>
            <p>
              interval map
            </p>
            </td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>
        <a class="link" href="subtraction.html" title="Subtraction"><span class="emphasis"><em><span class="bold"><strong>Subtraction</strong></span></em></span></a>, <a class="link" href="erasure.html" title="Erasure"><span class="emphasis"><em><span class="bold"><strong>erasure</strong></span></em></span></a>, <a class="link" href="intersection.html" title="Intersection"><span class="emphasis"><em><span class="bold"><strong>intersection</strong></span></em></span></a>
      </p>
<p>
        and <a class="link" href="containedness.html" title="Containedness"><span class="emphasis"><em><span class="bold"><strong>containedness</strong></span></em></span></a> predicates can be
        used with those kinds of key types. For instance, the overload table for
        intersection
      </p>
<p>
        
</p>
<pre class="programlisting"><span class="comment">// overload tables for
</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">&amp;=</span> <span class="special">(</span><span class="identifier">T</span><span class="special">&amp;,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;)</span>

<span class="identifier">element</span> <span class="identifier">containers</span><span class="special">:</span>     <span class="identifier">interval</span> <span class="identifier">containers</span><span class="special">:</span>  
<span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span>            <span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>    
<span class="special">---+--------</span>            <span class="special">---+------------</span>    
<span class="identifier">s</span>  <span class="special">|</span> <span class="identifier">s</span>   <span class="identifier">s</span>              <span class="identifier">S</span>  <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span>     <span class="identifier">S</span>       
<span class="identifier">m</span>  <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">m</span>            <span class="identifier">M</span>  <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span>    
</pre>
<p>
      </p>
<p>
        has a part that that allows for selection by key objects
      </p>
<p>
        
</p>
<pre class="programlisting"><span class="identifier">element</span> <span class="identifier">containers</span><span class="special">:</span>     <span class="identifier">interval</span> <span class="identifier">containers</span><span class="special">:</span>  
<span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span>            <span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>    
<span class="special">---+--------</span>            <span class="special">---+------------</span>    
<span class="identifier">s</span>  <span class="special">|</span> <span class="identifier">s</span>   <span class="identifier">s</span>              <span class="identifier">S</span>  <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span>     <span class="identifier">S</span>       
<span class="identifier">m</span>  <span class="special">|</span> <span class="identifier">m</span>   <span class="identifier">m</span>              <span class="identifier">M</span>  <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span>     <span class="identifier">M</span>      
</pre>
<p>
      </p>
<p>
        and another part that provides overloads for generalized intersection:
      </p>
<p>
        
</p>
<pre class="programlisting"><span class="identifier">element</span> <span class="identifier">containers</span><span class="special">:</span>     <span class="identifier">interval</span> <span class="identifier">containers</span><span class="special">:</span>  
<span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span>            <span class="special">&amp;=</span> <span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>    
<span class="special">---+--------</span>            <span class="special">---+------------</span>    
<span class="identifier">s</span>  <span class="special">|</span> <span class="identifier">s</span>   <span class="identifier">s</span>              <span class="identifier">S</span>  <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span>     <span class="identifier">S</span>       
<span class="identifier">m</span>  <span class="special">|</span>   <span class="identifier">m</span>   <span class="identifier">m</span>            <span class="identifier">M</span>  <span class="special">|</span>     <span class="identifier">M</span> <span class="identifier">M</span>   <span class="identifier">M</span>      
</pre>
<p>
      </p>
<p>
        For <code class="computeroutput"><span class="identifier">Sets</span></code>, the <span class="emphasis"><em><span class="bold"><strong>key types</strong></span></em></span> defined for maps are identical
        with the set types themselves. So the distinction between the function groups
        <span class="emphasis"><em><span class="bold"><strong>selection by key</strong></span></em></span> and
        <span class="emphasis"><em><span class="bold"><strong>generalized intersection</strong></span></em></span>
        fall together in the well known <span class="emphasis"><em><span class="bold"><strong>set intersection</strong></span></em></span>.
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2007 -2010 Joachim Faulhaber<br>Copyright &#169; 1999 -2006 Cortex Software GmbH<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="segmentational_fineness.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="construct__copy__destruct.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
